#pragma once
#include <math.h>

#define uchar unsigned char
#define uint unsigned int

#define SQRT2 1.41421356237309504880168872420969807856967187537694
#define MIN(x, y)	( (x)<(y) ? (x) : (y) )
#define MAX(x, y)	( (x)>(y) ? (x) : (y) )
#define RINT(x)	 ( (x)-floor(x)>0.5? ceil(x) : floor(x) )
#define afloor(x) ( (x)-floor(x) )

inline double log2f(double x)
{ 
	return (log(x) / log(2.0f)); 
}

inline double log2(double x){ 
	static const double c = 1.0 / log(2.0); 
	return log(x) * c; 
}
